--TEST--
Check for jsonschema  generate array
--SKIPIF--
<?php
if (!extension_loaded("jsonschema")) {
    print "skip";
}
?>
--FILE--
<?php
echo 'array Map', PHP_EOL;
$value = array();
$value['name'] = 'a name';
$value['age'] = 23;
$value['height'] = 183.5;
$jsonSchema = new JsonSchema(json_encode($value));

echo assert('{"type":"object","properties":{"name":{"type":"string","format":"regex","pattern":"\/^[a-z0-9]+$\/i","minLength":0,"maxLength":2147483647},"age":{"type":"integer","default":0,"minimum":0,"maximum":2147483647,"exclusiveMinimum":0,"exclusiveMaximum":2147483647},"height":{"type":"number","default":0,"minimum":0,"maximum":2147483647,"exclusiveMinimum":0,"exclusiveMaximum":2147483647}}}' == $jsonSchema->getSchema()), PHP_EOL;

$value = array();
$value[] = 'a name';
$value[] = 23;
$value[] = 183.5;
$jsonSchema = new JsonSchema(json_encode($value));

echo assert('{"type":"array","minItems":0,"maxItems":20,"items":{"type":"string","format":"regex","pattern":"\/^[a-z0-9]+$\/i","minLength":0,"maxLength":2147483647}}' == $jsonSchema->getSchema()), PHP_EOL;

$value = array();
$value['users'][] = array('id' => 1, 'account' => 'userA');
$value['users'][] = array('id' => 3, 'account' => 'userB');
$value['users'][] = array('id' => 5, 'account' => 'userC');
$jsonSchema = new JsonSchema(json_encode($value));

echo assert('{"type":"object","properties":{"users":{"type":"array","minItems":0,"maxItems":20,"items":{"type":"object","properties":{"id":{"type":"integer","default":0,"minimum":0,"maximum":2147483647,"exclusiveMinimum":0,"exclusiveMaximum":2147483647},"account":{"type":"string","format":"regex","pattern":"\/^[a-z0-9]+$\/i","minLength":0,"maxLength":2147483647}}}}}}' == $jsonSchema->getSchema()), PHP_EOL;
?>
--EXPECT--
1
1
1